package com.itheima.reggie.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.itheima.reggie.pojo.Employee;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface EmployeeDao extends BaseMapper<Employee> {
    List<Employee> findByName(@Param("name") String name);

    @Select("select * from employee where id=#{id}")
    Employee findById(Long id);

    @Insert("insert into employee values(null,#{name},#{username},#{password},#{phone},#{sex},#{idNumber},#{status},#{createTime},#{updateTime},#{createUser},#{updateUser})")
    void save(Employee employee);
    /**
     * 修改员工
     */
    void update(Employee employee);

}
